<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>

    var person = {
        "name": "tom",
        "age": 20,
        "sex": [
            {"persons": "jack", "ages": 21},
            {"persons": "jack", "ages": 21}
        ]
    }
    alert(person.sex[0].persons);
    alert(person["age"]);

    //for循环获取值
    for (var key in person) {

        alert(key + ":" + person[key]);
    }

</script>

</body>
</html>